<template>
  <div>
      <div class="divBox" @click="divClick">
        <!-- stop阻止冒泡 -->
        <button @click.stop="btnClick">点击</button>
      </div>

      <form action="">
        <!-- prevent阻止默认事件 -->
        <input type="submit" value="提交" @click.prevent="submit">
      </form>

      <input type="text" @keyup.enter="search">


      <input type="text" v-model.number="count" @keyup.enter="search">
  </div>
</template>
<script>
export default {
  data() {
    return {
      count: null
    }
  },
  methods: {
    btnClick() {
      console.log('按钮点击事件')
    },
    divClick() {
      console.log('div点击事件')
    },

    submit() {
      
    },

    search() {
      console.log('开始搜索')
      console.log(this.count)
    }
  }
}
</script>
<style>
  .divBox{
    width: 200px;
    height: 200px;
    background-color: red;
  }
</style>